package com.yan.listener;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * TODO
 *
 * @Author: 汪焰
 * @Date: 2021/7/6 23:42
 */
@Component
public class RabbitMQMessageListener {

    @RabbitListener(queues = "queue.boot.name.yan")
    public void onMessage(@Payload String message, @Header(name = "hello") String value) {
        System.out.println("------ConsumerApplication--------RabbitMQMessageListener-----message-------" + message);
        System.out.println("------ConsumerApplication--------RabbitMQMessageListener-----value-------" + value);
    }

}
